﻿<?php
//Leav:file nay dung de lay mot record theo id_record ($arr_single_record);
$v_record_id = 0;
if(isset($_REQUEST['hdn_record_id'])){
	$v_record_id = intval($_REQUEST['hdn_record_id']);
}
$v_recordtype_filter = $_SESSION['onegate_current_recordtype'];
$v_status = 1;
$v_filter = "";
$v_cate_id= 0;
if(_is_sqlserver()){
	$sql = "Exec ONEGATE_RecordtypeGetAll " ;
	$sql = $sql.$v_status.",";
	$sql = $sql.$v_cate_id.",";
	$sql = $sql."'".$v_filter."'";
	$ado_conn->SetFetchMode(ADODB_FETCH_NUM);
	$arr_all_recordtype = $ado_conn->GetAll($sql); 
	///
	$sql = "Exec Onegate_RecordGetSingle " . $v_record_id ;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$arr_single_record = $ado_conn->GetRow($sql); 
	
	$arr_single_record[C_RECEIVED_RECORD_XML_DATA] = stripslashes($arr_single_record[C_RECEIVED_RECORD_XML_DATA]);
	$arr_single_record[C_LICENSE_XML_DATA] = stripslashes($arr_single_record[C_LICENSE_XML_DATA]);
	////Leav_update_29/05/2008_begin
	$sql = "Exec Onegate_RecordGetSingle_WorkType_PunishContent_Leav ".$v_record_id ;
	$ado_conn->SetFetchMode(ADODB_FETCH_NUM);
	$arr_single_record_in_worktype = $ado_conn->GetAll($sql);//lay ra record co worktype 'NOI_DUNG_THONG_BAO_THUE'
	$v_list_of_recordById=sizeof($arr_single_record_in_worktype);
	$v_pk_record_work=$arr_single_record_in_worktype[0][0];
	//
	$sql = "Exec Onegate_RecordGetSingle_Announce_Leav ".$v_pk_record_work ;
	$ado_conn->SetFetchMode(ADODB_FETCH_NUM);
	$arr_single_record_announce = $ado_conn->GetAll($sql);
	////Leav_update_29/05/2008_end
}?>
